import React from 'react';
import './VideoCard.css';

interface VideoCardProps {
    video: {
        title: string;
        channel: string;
        duration: string;
        views: string;
        uploadTime: string;
        isNew: boolean;
    };
    onOpenVideo: (video: any) => void;
}

const VideoCard: React.FC<VideoCardProps> = ({ video, onOpenVideo }) => {
    return (
        <div className="video-card" onClick={() => onOpenVideo(video)}>
            <div className="video-thumbnail">
                <span>视频缩略图</span>
                <div className="video-duration">{video.duration}</div>
            </div>
            <div className="video-info">
                <div className="video-title">{video.title}</div>
                <div className="video-meta">
                    <div>
                        <div className="channel-name">{video.channel}</div>
                        <div className="video-stats">
                            <span>{video.views}次观看</span>
                            <span>•</span>
                            <span>{video.uploadTime}</span>
                            {video.isNew && <span className="new-badge">NEW</span>}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    );
};

export default VideoCard;
